package hyy_2022;

import java.text.DecimalFormat;

/**
 * 字符串相加
 */
public class _0715_415_AddStrings {
    public static void main(String[] args) {
        String num1 = "9333852702227987";
        String num2 = "85731737104263";
        System.out.println(addStrings(num1,num2));
    }
    public static String addStrings(String num1, String num2) {

        Long n = 0L;
        for(int i=0;i<num1.length();i++) {
            int c = Integer.parseInt(String.valueOf(num1.charAt(i)));
            int temp = 10;

            n = n + (long)(c * Math.pow(10,(num1.length() - 1) - i));
        }

        Long m = 0L;
        for(int i=0;i<num2.length();i++) {
            int c = Integer.parseInt(String.valueOf(num2.charAt(i)));
            m = m + (long)(c * Math.pow(10,(num2.length() - 1) - i));
        }
        DecimalFormat decimalFormat = new DecimalFormat("###################.###########");
        System.out.println(m);
        System.out.println(n);
        return  decimalFormat.format(m+n);
    }
}
